﻿<UserControl x:Class="Oxage.CNC.Views.MainView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:c="clr-namespace:Oxage.CNC"
	xmlns:v="clr-namespace:Oxage.CNC.Views"
	xmlns:m="clr-namespace:Oxage.CNC.Models">
  <UserControl.DataContext>
    <m:MainViewModel />
  </UserControl.DataContext>
  <Grid x:Name="LayoutRoot">
    <DockPanel>

      <!-- Menu -->
      <Menu DockPanel.Dock="Top" ToolBar.OverflowMode="Never">
        <MenuItem Header="File">
          <MenuItem Header="New" Command="{Binding DocumentCommand}" CommandParameter="New" />
          <MenuItem Header="Open" Command="{Binding DocumentCommand}" CommandParameter="Open" />
          <MenuItem Header="Save" Command="{Binding DocumentCommand}" CommandParameter="Save" />
          <MenuItem Header="Save as..." Command="{Binding DocumentCommand}" CommandParameter="SaveAs" />
          <Separator />
          <MenuItem Header="Exit" Command="{Binding ApplicationCommand}" CommandParameter="Exit" />
        </MenuItem>
        <!--<MenuItem Header="Options">
          <MenuItem Header="Preferences" />
        </MenuItem>-->
        <MenuItem Header="Machine">
          <MenuItem Header="Start" Command="{Binding MachineCommand}" CommandParameter="Start" />
          <MenuItem Header="Stop" Command="{Binding MachineCommand}" CommandParameter="Stop" />
        </MenuItem>
        <MenuItem Header="Simulator">
          <MenuItem Header="Quick draw" Command="{Binding SimulatorCommand}" CommandParameter="QuickDraw" />
          <MenuItem Header="Clear" Command="{Binding SimulatorCommand}" CommandParameter="Clear" />
        </MenuItem>
      </Menu>
    
      <!-- Content -->
      <Grid Margin="5">
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="3*" />
          <RowDefinition Height="1*" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="1">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*" />
            <ColumnDefinition Width="1*" />
          </Grid.ColumnDefinitions>
        
          <!-- Left -->
          <TabControl Grid.Column="0" Margin="0,0,2,0">
            <TabItem Header="Editor">
              <v:EditorView x:Name="Editor" Document="{Binding Document}" />
            </TabItem>
            <TabItem Header="Console">
              <v:ConsoleView />
            </TabItem>
            <TabItem Header="Control">
              <v:ControlView x:Name="Control" />
            </TabItem>
          </TabControl>
        
          <!-- Splitter -->
          <GridSplitter Grid.Column="0" Width="2" Background="#FF333333" />
        
          <!-- Right -->
          <TabControl Grid.Column="1" Margin="0,0,0,0">
            <TabItem Header="Simulator">
              <v:SimulatorView x:Name="Simulator" />
            </TabItem>
            <TabItem Header="Config">
              <v:ConfigView x:Name="Config" />
            </TabItem>
          </TabControl>
        </Grid>
      
        <!-- Splitter -->
        <GridSplitter Grid.Row="1" Height="2" ResizeDirection="Rows" Background="#FF333333" />

        <Grid Grid.Row="2">
          <v:LogView x:Name="Log" Margin="0,2,0,0" />
        </Grid>

      </Grid>

    </DockPanel>
  </Grid>
</UserControl>
